using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Xml;
using Northwoods.Go;
using Northwoods.Go.Xml;

namespace Workflows.Diagrams
{
    [Serializable()]
    public class TransformComment : GoXmlTransformer
    {
        public TransformComment()
        {
            this.TransformerType = typeof(GoComment);
            this.ElementName = "comment";
        }

        public override void GenerateAttributes(object obj)
        {
            base.GenerateAttributes(obj);
            GoComment c = (GoComment)obj;
            this.WriteAttrVal("xy", c.Position);
            this.WriteAttrVal("text", c.Text);
        }

        public override void ConsumeAttributes(object obj)
        {
            base.ConsumeAttributes(obj);
            GoComment c = (GoComment)obj;
            c.Position = PointFAttr("xy", new PointF(10, 10));
            c.Text = StringAttr("text", string.Empty);
        }
    }
}
